<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="keyword">
    <button type="button" id="btn">百度一下</button>
    <script>
        // 1、查哈看location对象
        console.log(location);
        // 2、实现地址跳转
        // location对下的href属性 如果直接调用 就表示取出当前的地址，如果进行赋值 浏览器就会自动跳转
        btn.onclick = function(){
            // console.log(location.href)
            // location.href = 'http://www.baidu.com'
            // location.assign('http://www.baidu.com')
            // location.replace('http://www.baidu.com')
            // 跳转百度搜索
            location.href = 'https://www.baidu.com/s?wd='+keyword.value
        }
        
    </script>

    <button id="sx">刷新</button>
    <script>
        sx.onclick = function(){
            location.reload();
        }
    </script>
</body>
</html>